/// <reference path="Scripts/typings/signalr/signalr.d.ts" />
/// <reference path="Scripts/typings/knockout/knockout.d.ts" />
/// <reference path="Scripts/typings/knockout.mapping/knockout.mapping.d.ts" />
/// <reference path="AutomatonViewModel.ts" />
/// <reference path="GlobalViewModel.ts" />

declare var sigma: any;

var viewModel = new DMath.GlobalViewModel();
var dispatcher = $.connection["dispatcher"];
dispatcher.client.updatedMachine = function (automaton) {
	if (viewModel.automata().length == 0)
		viewModel.createNewAutomaton(automaton);
}
var sig;
window.onload = () => {
	$.connection.hub.start().done();
	ko.applyBindings(viewModel);
};
